import request from '@/config/axios'

// 耗水 VO
export interface WaterVO {
  id: number // id
  houseId: number // 农舍
  weight: number // 耗水
  description: string // 描述
  status: number // 状态
}

// 耗水 API
export const WaterApi = {
  // 查询耗水分页
  getWaterPage: async (params: any) => {
    return await request.get({ url: `/farm/water/page`, params })
  },

  // 查询耗水详情
  getWater: async (id: number) => {
    return await request.get({ url: `/farm/water/get?id=` + id })
  },

  // 新增耗水
  createWater: async (data: WaterVO) => {
    return await request.post({ url: `/farm/water/create`, data })
  },

  // 修改耗水
  updateWater: async (data: WaterVO) => {
    return await request.put({ url: `/farm/water/update`, data })
  },

  // 删除耗水
  deleteWater: async (id: number) => {
    return await request.delete({ url: `/farm/water/delete?id=` + id })
  },

  // 导出耗水 Excel
  exportWater: async (params) => {
    return await request.download({ url: `/farm/water/export-excel`, params })
  },
    // 下载耗水导入模板=
  importWaterTemplate:async() => {
    return request.download({
      url: '/farm/water/get-import-template' 
    })
  }
}
